Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic structure and point addition proofs #22

Merged
merged 7 commits into from
Sep 7, 2023
Merged

Basic structure and point addition proofs #22

merged 7 commits into from
Sep 7, 2023

Conversation

joerowell
Copy link
Contributor

@joerowell joerowell commented Sep 6, 2023

This PR implements:

  1. The scalar equality proof.
  2. The scalar opening proof.
  3. The scalar multiplication proof (i.e proving that z = x * y)
  4. The point addition proof.

For both T256 and T384. The code also provides Pedersen commitments etc. We also have tests and some conversion functions from the arkworks curves to our curves (this was a real pain to get working!)


Just to make it clearer: this PR essentially implements everything up to (the current) Section 4.1. Namely, this PR does not implement the Section 4.2 protocol yet.

Features:

1. Equality proofs for Pedersen commitments.
2. Opening proofs for scalars.
3. Multiplication proofs for scalars.
There's got to be a nicer way to do this: the From trait is probably
the best way to go.
Also add derives for Clones + Copies because, quite frankly,
the idea that operators take ownership is kinda stupid.
@claucece
Copy link
Member

claucece commented Sep 6, 2023

Looking good by a quick review! Will do a in-depth one later

@joerowell
Copy link
Contributor Author

So I actually only need one thing from either / both of you: it works, and we can always refactor later.

At the moment, we set up the transcript like this:

https://github.com/brave-experiments/zk-ary/blob/27906f85b016bec9284dd873ef679f51e71812cf/src/pedersen/src/equality_protocol.rs#L24-L41

Namely, we don't pass the randomness values into the transcript, only the Pedersen commitments themselves.

Does this matter? I'm happy to add it, but I'm not sure if there's a strong theoretical reason why we need this.

@levanin
Copy link
Contributor

levanin commented Sep 7, 2023

Hey Joe, nice job, looks good! The commitment objects look like they have the randomness as an attribute right? So you wouldn't want them in the transcript since they are part of the secret.

Maybe I'm misreading the code but it seems the verifier gets the c1, c2 as input in the equality protocol for instance, which are PedersenComm

objects. But you shouldn't need them since you can recover the values of the commitment via the transcript input.

@claucece claucece merged commit c248397 into main Sep 7, 2023
1 check passed
@joerowell
Copy link
Contributor Author

Hey Joe, nice job, looks good! The commitment objects look like they have the randomness as an attribute right? So you wouldn't want them in the transcript since they are part of the secret.

Maybe I'm misreading the code but it seems the verifier gets the c1, c2 as input in the equality protocol for instance, which are PedersenComm

objects. But you shouldn't need them since you can recover the values of the commitment via the transcript input.

This is addressed in #25.

@joerowell joerowell deleted the proofs branch September 11, 2023 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants